/*
 * ListItem.java
 *
 * Created on 2007�~1��27��, �U�� 3:06
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package org.sais.eswn.ui;

import java.awt.*;
import org.sais.eswn.card.Card;
import org.sais.eswn.card.cardlabel.UniLabel;
import org.sais.eswn.tool.Tools;

/**
 *
 * @author Romulus
 */
public class ListItem {

    private Color color;
    private String displayText;
    public UniLabel label;

    public ListItem(Color c, String s, UniLabel label) {
        color = c;
        Card card = Tools.getCard(label.cardno);
        switch (card.getType()) {
            case Card.CARDTYPE_SPELL:
                displayText = card.text.getCost() + " " + card.text.getFire().getShortDisplayText()
                        + "/" + card.text.getConquer().getShortDisplayText() + " " + s;
                break;
            case Card.CARDTYPE_EVENT:
                displayText = ((int) card.text.getCost()) + " " + s;
                break;
        }
        this.label = label;
    }

    public ListItem(Color c, String s, UniLabel card, int region) {
        this(c, s, card);
        card.setRegion(region);
        card.setPopupMenu();
    }

    public Color getColor() {
        return color;
    }

    public String getValue() {
        return displayText;
    }
}

